package com.older.wptsb.controller.elder;


import com.older.wptsb.domain.dto.HealthDataDTO;
import com.older.wptsb.domain.dto.SosDTO;
import com.older.wptsb.domain.po.RequireRole;
import com.older.wptsb.domain.po.UserRole;
import com.older.wptsb.domain.vo.HealthDataVO;
import com.older.wptsb.service.ElderService;
import com.older.wptsb.util.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/elder")
public class ElderController {

    @Resource
    private ElderService elderService;

    //@RequireRole({UserRole.ROLE_ELDER})
    @PostMapping("/healthData")
    public void addElderHealthData(@RequestBody HealthDataDTO healthDataDTO) {
        elderService.addElderHealthData(healthDataDTO);
    }
    @RequireRole({UserRole.ROLE_ELDER})
    @PostMapping("/elderSOS")
    public void elderSOS(@RequestBody SosDTO sosDTO){
        elderService.elderSOS(sosDTO);
    }
}
